<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>配置设备信息</title>
    <link href="/layui/css/layui.css" rel="stylesheet">

</head>
<body>

<div class="layui-container" style="margin-top: 20px;">
    <div class="layui-row">
        <h1 id="title" style="text-align: center;">配置设备信息</h1>
        <div class="layui-row">
            <div class="layui-col-md4 layui-col-md-offset8">
                <div style="text-align: right;">
                    <button type="button" class="layui-btn layui-btn-xs" onclick="javascript:location.reload();">刷新配置</button>
                    <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" th:if="${dev}" onclick="javascript:dlconf();">下载配置</button>
                </div>
            </div>
        </div>
        <hr />
    </div>
    <div class="layui-row" th:if="${dev}">
        <form id="submitform" class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">设备号(IMEI)</label>
                <div class="layui-input-block">
                    <input type="text" name="imei" data-aprs4g="IMEI" autocomplete="off" class="layui-input" title="不可修改" th:value="${dev.imei}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">版本号</label>
                <div class="layui-input-block">
                    <input type="text" name="version" autocomplete="off" class="layui-input" title="不可修改" th:value="${dev.version}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">上次时间</label>
                <div class="layui-input-block">
                    <input type="text" name="curdate" autocomplete="off" class="layui-input" title="不可修改" th:value="${dev.curdate}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">总里程数(公里)</label>
                <div class="layui-input-block">
                    <input type="text" name="totalmileage" autocomplete="off" class="layui-input" title="不可修改" th:value="${dev.totalmileage}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Web指令服务端地址</label>
                <div class="layui-input-block">
                    <input disabled="disabled" type="text" name="webcmdhost" data-aprs4g="WEBCMD_HOST" maxlength="100" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.webcmdhost}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">呼号</label>
                <div class="layui-input-block">
                    <input type="text" name="callsign" data-aprs4g="CALLSIGN" maxlength="6"  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.callsign}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">验证码</label>
                <div class="layui-input-block">
                    <input type="number" name="passcode" data-aprs4g="PASSCODE" maxlength="6" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.passcode}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">SSID</label>
                <div class="layui-input-block">
                    <input type="text" name="ssid" data-aprs4g="SSID" maxlength="2" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.ssid}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">服务器地址</label>
                <div class="layui-input-block">
                    <input type="text" name="serverip" data-aprs4g="SERVER" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.serverip}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">服务器端口</label>
                <div class="layui-input-block">
                    <input type="number" name="serverport" data-aprs4g="PORT" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.serverport}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">TABLE</label>
                <div class="layui-input-block">
                    <input type="text" name="aprstable" data-aprs4g="TABLE" maxlength="1" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.aprstable}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">SYMBOL</label>
                <div class="layui-input-block">
                    <input type="text" name="aprssymbol" data-aprs4g="SYMBOL" maxlength="1" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.aprssymbol}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">信标文本</label>
                <div class="layui-input-block">
                    <input type="text" name="beacontext" data-aprs4g="BEACON_TEXT" maxlength="200" lay-verify="required" placeholder="示例：imei:*${imei} rssi:${rssi} sat:${satuse}\/${sattotal} temp:${temp} vol:${vol} pow:${pow}" autocomplete="off" class="layui-input" th:value="${dev.beacontext}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">信标状态文本</label>
                <div class="layui-input-block">
                    <input type="text" name="beacon" data-aprs4g="BEACON" maxlength="90" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.beacon}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">信标发送间隔(秒)</label>
                <div class="layui-input-block">
                    <input type="number" name="beaconinterval" data-aprs4g="BEACON_INTERVAL" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.beaconinterval}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">信标状态发送间隔(秒)</label>
                <div class="layui-input-block">
                    <input type="number" name="beaconstatusinterval" data-aprs4g="BEACON_STATUS_INTERVAL" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.beaconstatusinterval}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">静止递增间隔倍数(1-32)</label>
                <div class="layui-input-block">
                    <input type="number" name="maxdecay" data-aprs4g="MAX_DECAY" lay-verify="required" placeholder="请输入1-32之中，2的指数倍" autocomplete="off" class="layui-input" th:value="${dev.maxdecay}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">工作模式</label>
                <div class="layui-input-block">
                    <input type="radio" name="trackermode" value="1" title="移动台站" th:checked="${dev.trackermode} eq '1'?'checked':'false'">
                    <input type="radio" name="trackermode" value="2" title="固定台站" th:checked="${dev.trackermode} eq '2'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">固定台纬度</label>
                <div class="layui-input-block">
                    <input type="number" name="fixloclat" data-aprs4g="FIXLOC_LAT" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.fixloclat}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">固定台经度</label>
                <div class="layui-input-block">
                    <input type="number" name="fixloclng" data-aprs4g="FIXLOC_LNG" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.fixloclng}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">定位方式</label>
                <div class="layui-input-block">
                    <input type="radio" name="locmode" value="1" title="GPS定位" th:checked="${dev.locmode} eq '1'?'checked':'false'">
                    <input type="radio" name="locmode" value="2" title="基站定位" th:checked="${dev.locmode} eq '2'?'checked':'false'">
                    <input type="radio" name="locmode" value="3" title="混合定位" th:disabled="${dev.locmode} eq '3'?'disabled':'disabled'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">调皮模式</label>
                <div class="layui-input-block">
                    <input type="radio" name="trickmode" value="0" title="关闭" th:checked="${dev.trickmode} eq '0'?'checked':'false'">
                    <input type="radio" name="trickmode" value="1" title="开启" th:checked="${dev.trickmode} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">行进模式</label>
                <div class="layui-input-block">
                    <input type="radio" name="travelmode" value="0" title="驾车" th:checked="${dev.travelmode} eq '0'?'checked':'false'">
                    <input type="radio" name="travelmode" value="1" title="步行" th:checked="${dev.travelmode} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">显示版本号</label>
                <div class="layui-input-block">
                    <input type="radio" name="displayver" value="0" title="关闭" th:checked="${dev.displayver} eq '0'?'checked':'false'">
                    <input type="radio" name="displayver" value="1" title="开启" th:checked="${dev.displayver} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">消息上传平台</label>
                <div class="layui-input-block">
                    <input type="radio" name="plat" value="0" title="全部平台" th:checked="${dev.plat} eq '0'?'checked':'false'">
                    <input type="radio" name="plat" value="1" title="只上传aprs平台" th:checked="${dev.plat} eq '1'?'checked':'false'">
                    <input type="radio" name="plat" value="2" title="只上传Traccar平台" th:checked="${dev.plat} eq '2'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">TRACCAR服务端地址</label>
                <div class="layui-input-block">
                    <input type="text" name="traccarhost" data-aprs4g="TRACCAR_HOST" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.traccarhost}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否使用AGNSS辅助定位</label>
                <div class="layui-input-block">
                    <input type="radio" name="agnssenable" value="0" title="不使用AGNSS" th:checked="${dev.agnssenable} eq '0'?'checked':'false'">
                    <input type="radio" name="agnssenable" value="1" title="使用AGNSS" th:checked="${dev.agnssenable} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否使用喇叭（无喇叭不支持）</label>
                <div class="layui-input-block">
                    <input type="radio" name="audioenable" value="0" title="不使用" th:checked="${dev.audioenable} eq '0'?'checked':'false'">
                    <input type="radio" name="audioenable" value="1" title="使用" th:checked="${dev.audioenable} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">省电模式</label>
                <div class="layui-input-block">
                    <input type="radio" name="powersavemode" value="0" title="不使用" th:checked="${dev.powersavemode} eq '0'?'checked':'false'">
                    <input type="radio" name="powersavemode" value="1" title="静止省电" th:checked="${dev.powersavemode} eq '1'?'checked':'false'">
                    <input type="radio" name="powersavemode" value="2" title="定时省电" th:checked="${dev.powersavemode} eq '2'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">静止省电模式-最近静止时长(秒)</label>
                <div class="layui-input-block">
                    <input type="number" name="powersavemodetime" data-aprs4g="POWER_SAVE_MODE_TIME" lay-verify="required" placeholder="静止省电模式下静止多久进入省电模式，单位秒。默认值600   60（一分钟）-  3600（1小时）" autocomplete="off" class="layui-input" th:value="${dev.powersavemodetime}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">定时省电模式-每次启动时间(秒)</label>
                <div class="layui-input-block">
                    <input type="number" name="powersavemoded1time" data-aprs4g="POWER_SAVE_MODE_D1TIME" lay-verify="required" placeholder="定时省电模式下间隔多久定时关机,每次启动时间，默认300秒，单位秒。300（5分钟） -  86400（1天）" autocomplete="off" class="layui-input" th:value="${dev.powersavemoded1time}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">定时省电模式-每次休眠时间(秒)</label>
                <div class="layui-input-block">
                    <input type="number" name="powersavemoded2time" data-aprs4g="POWER_SAVE_MODE_D2TIME" lay-verify="required" placeholder="定时省电模式下间隔多久定时启动,每次休眠时间，默认值3600（一小时）单位秒。   1800（30分钟） -  604800（7天）" autocomplete="off" class="layui-input" th:value="${dev.powersavemoded2time}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否启用短信猫（不支持电信）</label>
                <div class="layui-input-block">
                    <input type="radio" name="smscatenable" value="0" title="关闭" th:checked="${dev.smscatenable} eq '0'?'checked':'false'">
                    <input type="radio" name="smscatenable" value="1" title="开启-转发到手机（存在短信费）" th:checked="${dev.smscatenable} eq '1'?'checked':'false'">
                    <input type="radio" name="smscatenable" value="2" title="开启-转发到平台（免费）" th:checked="${dev.smscatenable} eq '2'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">短信猫 转发目标手机号码</label>
                <div class="layui-input-block">
                    <input type="text" name="smscatmobile" data-aprs4g="SMS_CAT_MOBILE" lay-verify="required" placeholder="短信猫 转发目标手机号码" autocomplete="off" class="layui-input" th:value="${dev.smscatmobile}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">对讲模式</label>
                <div class="layui-input-block">
                    <input type="radio" name="talkmode" value="0" title="关闭" th:checked="${dev.talkmode} eq '0'?'checked':'false'">
                    <input type="radio" name="talkmode" value="1" title="开启" th:checked="${dev.talkmode} eq '1'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">对讲频道名</label>
                <div class="layui-input-block">
                    <input type="text" name="talkchannel" data-aprs4g="BEACON" maxlength="90" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" th:value="${dev.talkchannel}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">按钮功能选择</label>
                <div class="layui-input-block">
                    <input type="radio" name="btnmode" value="1" title="自主发射" th:checked="${dev.btnmode} eq '1'?'checked':'false'">
                    <input type="radio" name="btnmode" value="2" title="重读上次语音" th:checked="${dev.btnmode} eq '2'?'checked':'false'">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择诗词类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="shicitype" value="all" title="全部" th:checked="${dev.shicitype} eq 'all'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing" title="抒情" th:checked="${dev.shicitype} eq 'shuqing'?'checked':'false'">
                    <input type="radio" name="shicitype" value="siji" title="四季" th:checked="${dev.shicitype} eq 'siji'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui" title="山水" th:checked="${dev.shicitype} eq 'shanshui'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi" title="天气" th:checked="${dev.shicitype} eq 'tianqi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu" title="人物" th:checked="${dev.shicitype} eq 'renwu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng" title="人生" th:checked="${dev.shicitype} eq 'rensheng'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shenghuo" title="生活" th:checked="${dev.shicitype} eq 'shenghuo'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri" title="节日" th:checked="${dev.shicitype} eq 'jieri'?'checked':'false'">
                    <input type="radio" name="shicitype" value="dongwu" title="动物" th:checked="${dev.shicitype} eq 'dongwu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu" title="植物" th:checked="${dev.shicitype} eq 'zhiwu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shiwu" title="食物" th:checked="${dev.shicitype} eq 'shiwu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/aiqing" title="抒情-爱情" th:checked="${dev.shicitype} eq 'shuqing/aiqing'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/youqing" title="抒情-友情" th:checked="${dev.shicitype} eq 'shuqing/youqing'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/libie" title="抒情-离别" th:checked="${dev.shicitype} eq 'shuqing/libie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/sinian" title="抒情-思念" th:checked="${dev.shicitype} eq 'shuqing/sinian'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/sixiang" title="抒情-思乡" th:checked="${dev.shicitype} eq 'shuqing/sixiang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/shanggan" title="抒情-伤感" th:checked="${dev.shicitype} eq 'shuqing/shanggan'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/gudu" title="抒情-孤独" th:checked="${dev.shicitype} eq 'shuqing/gudu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/guiyuan" title="抒情-闺怨" th:checked="${dev.shicitype} eq 'shuqing/guiyuan'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/daowang" title="抒情-悼亡" th:checked="${dev.shicitype} eq 'shuqing/daowang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/huaigu" title="抒情-怀古" th:checked="${dev.shicitype} eq 'shuqing/huaigu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/aiguo" title="抒情-爱国" th:checked="${dev.shicitype} eq 'shuqing/aiguo'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shuqing/ganen" title="抒情-感恩" th:checked="${dev.shicitype} eq 'shuqing/ganen'?'checked':'false'">
                    <input type="radio" name="shicitype" value="siji/chuntian" title="四季-春天" th:checked="${dev.shicitype} eq 'siji/chuntian'?'checked':'false'">
                    <input type="radio" name="shicitype" value="siji/xiatian" title="四季-夏天" th:checked="${dev.shicitype} eq 'siji/xiatian'?'checked':'false'">
                    <input type="radio" name="shicitype" value="siji/qiutian" title="四季-秋天" th:checked="${dev.shicitype} eq 'siji/qiutian'?'checked':'false'">
                    <input type="radio" name="shicitype" value="siji/dongtian" title="四季-冬天" th:checked="${dev.shicitype} eq 'siji/dongtian'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/lushan" title="山水-庐山" th:checked="${dev.shicitype} eq 'shanshui/lushan'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/taishan" title="山水-泰山" th:checked="${dev.shicitype} eq 'shanshui/taishan'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/jianghe" title="山水-江河" th:checked="${dev.shicitype} eq 'shanshui/jianghe'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/changjiang" title="山水-长江" th:checked="${dev.shicitype} eq 'shanshui/changjiang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/huanghe" title="山水-黄河" th:checked="${dev.shicitype} eq 'shanshui/huanghe'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/xihu" title="山水-西湖" th:checked="${dev.shicitype} eq 'shanshui/xihu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shanshui/pubu" title="山水-瀑布" th:checked="${dev.shicitype} eq 'shanshui/pubu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/xiefeng" title="天气-写风" th:checked="${dev.shicitype} eq 'tianqi/xiefeng'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/xieyun" title="天气-写云" th:checked="${dev.shicitype} eq 'tianqi/xieyun'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/xieyu" title="天气-写雨" th:checked="${dev.shicitype} eq 'tianqi/xieyu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/xiexue" title="天气-写雪" th:checked="${dev.shicitype} eq 'tianqi/xiexue'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/caihong" title="天气-彩虹" th:checked="${dev.shicitype} eq 'tianqi/caihong'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/taiyang" title="天气-太阳" th:checked="${dev.shicitype} eq 'tianqi/taiyang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/yueliang" title="天气-月亮" th:checked="${dev.shicitype} eq 'tianqi/yueliang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="tianqi/xingxing" title="天气-星星" th:checked="${dev.shicitype} eq 'tianqi/xingxing'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu/nvzi" title="人物-女子" th:checked="${dev.shicitype} eq 'renwu/nvzi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu/fuqin" title="人物-父亲" th:checked="${dev.shicitype} eq 'renwu/fuqin'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu/muqin" title="人物-母亲" th:checked="${dev.shicitype} eq 'renwu/muqin'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu/laoshi" title="人物-老师" th:checked="${dev.shicitype} eq 'renwu/laoshi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="renwu/ertong" title="人物-儿童" th:checked="${dev.shicitype} eq 'renwu/ertong'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/lizhi" title="人生-励志" th:checked="${dev.shicitype} eq 'rensheng/lizhi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/zheli" title="人生-哲理" th:checked="${dev.shicitype} eq 'rensheng/zheli'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/qingchun" title="人生-青春" th:checked="${dev.shicitype} eq 'rensheng/qingchun'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/shiguang" title="人生-时光" th:checked="${dev.shicitype} eq 'rensheng/shiguang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/mengxiang" title="人生-梦想" th:checked="${dev.shicitype} eq 'rensheng/mengxiang'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/dushu" title="人生-读书" th:checked="${dev.shicitype} eq 'rensheng/dushu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="rensheng/zhanzheng" title="人生-战争" th:checked="${dev.shicitype} eq 'rensheng/zhanzheng'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shenghuo/xiangcun" title="生活-乡村" th:checked="${dev.shicitype} eq 'shenghuo/xiangcun'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shenghuo/tianyuan" title="生活-田园" th:checked="${dev.shicitype} eq 'shenghuo/tianyuan'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shenghuo/biansai" title="生活-边塞" th:checked="${dev.shicitype} eq 'shenghuo/biansai'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shenghuo/xieqiao" title="生活-写桥" th:checked="${dev.shicitype} eq 'shenghuo/xieqiao'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/chunjie" title="节日-春节" th:checked="${dev.shicitype} eq 'jieri/chunjie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/yuanxiaojie" title="节日-元宵节" th:checked="${dev.shicitype} eq 'jieri/yuanxiaojie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/hanshijie" title="节日-寒食节" th:checked="${dev.shicitype} eq 'jieri/hanshijie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/qingmingjie" title="节日-清明节" th:checked="${dev.shicitype} eq 'jieri/qingmingjie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/duanwujie" title="节日-端午节" th:checked="${dev.shicitype} eq 'jieri/duanwujie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/qixijie" title="节日-七夕节" th:checked="${dev.shicitype} eq 'jieri/qixijie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/zhongqiujie" title="节日-中秋节" th:checked="${dev.shicitype} eq 'jieri/zhongqiujie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="jieri/chongyangjie" title="节日-重阳节" th:checked="${dev.shicitype} eq 'jieri/chongyangjie'?'checked':'false'">
                    <input type="radio" name="shicitype" value="dongwu/xieniao" title="动物-写鸟" th:checked="${dev.shicitype} eq 'dongwu/xieniao'?'checked':'false'">
                    <input type="radio" name="shicitype" value="dongwu/xiema" title="动物-写马" th:checked="${dev.shicitype} eq 'dongwu/xiema'?'checked':'false'">
                    <input type="radio" name="shicitype" value="dongwu/xiemao" title="动物-写猫" th:checked="${dev.shicitype} eq 'dongwu/xiemao'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/meihua" title="植物-梅花" th:checked="${dev.shicitype} eq 'zhiwu/meihua'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/lihua" title="植物-梨花" th:checked="${dev.shicitype} eq 'zhiwu/lihua'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/taohua" title="植物-桃花" th:checked="${dev.shicitype} eq 'zhiwu/taohua'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/hehua" title="植物-荷花" th:checked="${dev.shicitype} eq 'zhiwu/hehua'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/juhua" title="植物-菊花" th:checked="${dev.shicitype} eq 'zhiwu/juhua'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/liushu" title="植物-柳树" th:checked="${dev.shicitype} eq 'zhiwu/liushu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/yezi" title="植物-叶子" th:checked="${dev.shicitype} eq 'zhiwu/yezi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="zhiwu/zhuzi" title="植物-竹子" th:checked="${dev.shicitype} eq 'zhiwu/zhuzi'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shiwu/xiejiu" title="食物-写酒" th:checked="${dev.shicitype} eq 'shiwu/xiejiu'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shiwu/xiecha" title="食物-写茶" th:checked="${dev.shicitype} eq 'shiwu/xiecha'?'checked':'false'">
                    <input type="radio" name="shicitype" value="shiwu/lizhi" title="食物-荔枝" th:checked="${dev.shicitype} eq 'shiwu/lizhi'?'checked':'false'">

                </div>
            </div>

            <div class="layui-form-item" style="text-align: center;margin-bottom: 100px;" >
                <button type="submit" lay-submit class="layui-btn layui-btn-warm layui-btn-radius" lay-filter="sxpz" >生效配置（请1分钟内重启设备）</button>
            </div>
        </form>
    </div>
</div>

<script src="/layui/layui.js"></script>
<script>
    let $ = layui.$;
    // Usage
    layui.use(function(){
        var layer = layui.layer;
        var form = layui.form;
        // Welcome
        layer.msg('加载完毕', {icon: 6});

        // 提交事件
        form.on('submit(sxpz)', function(data){
            var field = data.field; // 获取表单字段值
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4 && xhr.status === 200) {
                    var rs = eval("(" + xhr.responseText + ")");
                    if (rs.retCode === "0000") {
                        layer.msg('已生效配置，请1分钟内重启设备!');
                    } else {
                        layer.msg('操作失败，请参数填写否正确!', {icon: 2});
                    }
                } else {
                    if (xhr.readyState === 4) {
                        layer.msg('操作失败，请检查网络是否正常!', {icon: 2});
                    }
                }
            };
            xhr.open("POST", "/aprs4g/takeeffect");
            xhr.setRequestHeader('Content-Type', 'application/json')
            xhr.send(JSON.stringify(field));
            return false; // 阻止默认 form 跳转
        });
    });
    $.fn.serializeJson = function () {
        var serializeObj = {};
        var array = this.serializeArray();
        $.each(array, function () {
            if (serializeObj[this.name] !== undefined) {
                if (!serializeObj[this.name].push) {
                    serializeObj[this.name] = [serializeObj[this.name]];
                }
                serializeObj[this.name].push(this.value || '');
            } else {
                serializeObj[this.name] = this.value || '';
            }
        });
        return serializeObj;
    };

    function dlconf(){
        var _data = $("#submitform").serializeJson();
        var data = {};
        data.IMEI = _data.imei;
        data.CALLSIGN = _data.callsign;
        data.PASSCODE = _data.passcode;
        data.SSID = _data.ssid;
        data.SERVER = _data.serverip;
        data.PORT = _data.serverport;
        data.TABLE = _data.aprstable;
        data.SYMBOL = _data.aprssymbol;
        data.BEACON = _data.beacon;
        data.BEACON_INTERVAL = _data.beaconinterval;
        data.BEACON_STATUS_INTERVAL = _data.beaconstatusinterval;
        data.MAX_DECAY = _data.maxdecay;
        data.TRACKERMODE = _data.trackermode;
        data.FIXLOC_LAT = _data.fixloclat;
        data.FIXLOC_LNG = _data.fixloclng;
        data.LOCMODE = _data.locmode;
        data.TRACCAR_HOST = _data.traccarhost;
        data.PLAT = _data.plat;
        data.WEBCMD_HOST = _data.webcmdhost;
        data.TRICK_MODE = _data.trickmode;
        data.TRAVEL_MODE = _data.travelmode;
        data.DISPLAY_VER = _data.displayver;
        data.BEACON_TEXT = _data.beacontext;
        data.AGNSS_ENABLE = _data.agnssenable;
        data.AUDIO_ENABLE = _data.audioenable;
        data.POWER_SAVE_MODE = _data.powersavemode;
        data.POWER_SAVE_MODE_TIME = _data.powersavemodetime;
        data.POWER_SAVE_MODE_D1TIME = _data.powersavemoded1time;
        data.POWER_SAVE_MODE_D2TIME = _data.powersavemoded2time;
        data.SMS_CAT_ENABLE = _data.smscatenable;
        data.SMS_CAT_MOBILE = _data.smscatmobile;
        data.TOTAL_MILEAGE = _data.totalmileage;
        data.SHICI_TYPE = _data.shicitype;
        data.TALK_MODE = _data.talkmode;
        data.TALK_CHANNEL = _data.talkchannel;
        data.BTN_MODE = _data.btnmode;
        const str = JSON.stringify(data, null, 2);
        const url = `data:,${str}`;
        const dl = document.createElement('a');
        dl.href = url;
        dl.download = "aprsconf.txt";
        dl.click();
    }
    function saveconf(){

    }

</script>
</body>
</html>